﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="GlobalSetting.aspx.cs" Inherits="GlobalSettingaspx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    
 
    
  
    
 
    
    <style type="text/css">
        .style1
        {
            color: #FFFFFF;
        }
        .style2
        {
            color: #FFFFFF;
            background-color: #738A9C;
        }
        .style44
        {
            color: #FFFFFF;
            background-color: #738A9C;
        }
    </style>
    
 
    
  
    
 
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <h2 class="bold">
        <strong><span class="style11">Administrator Settings</span>
        </strong>
    </h2>
    <h2 class="bold">
        <table style="width:100%;">
            <tr class="style1">
                <td class="style2" style="border: thin solid #000000">
                    Global Settings</td>
                <td align="center" class="style2" style="border: thin solid #000000">
                    GAme Settings</td>
            </tr>
            <tr>
                <td class="style7" rowspan="2" bgcolor="#999999" 
                    style="border: thin solid #000000" valign="top">
                    <asp:FormView ID="FormView1" runat="server" align="left" CssClass="style3" 
                        DataSourceID="SqlDataSource1" DefaultMode="Edit" Height="205px" 
                        style="text-align: left; color: #000000; font-size: medium; margin-right: 0px;" 
                        Width="371px" DataKeyNames="GlobalSettingID">
                        <EditItemTemplate>
                            Global Setting ID:
                            <asp:Label ID="GlobalSettingIDLabel1" runat="server" 
                                Text='<%# Eval("GlobalSettingID") %>' />
                            <br />
                            Password Length:
                            <asp:TextBox ID="PasswordLengthTextBox" runat="server" 
                                Text='<%# Bind("PasswordLength") %>' />
                            <br />
                            Password Expiry:
                            <asp:TextBox ID="PasswordExpiryTextBox" runat="server" 
                                Text='<%# Bind("PasswordExpiry") %>' />
                            <br />
                            Minimum Upper-Case:
                            <asp:TextBox ID="MinUpperCaseTextBox" runat="server" 
                                Text='<%# Bind("MinUpperCase") %>' />
                            <br />
                            Minimum Lower-Case:
                            <asp:TextBox ID="MinLowerCaseTextBox" runat="server" 
                                Text='<%# Bind("MinLowerCase") %>' />
                            <br />
                            Minimum Special-Char:
                            <asp:TextBox ID="MinSpecialCharTextBox" runat="server" 
                                Text='<%# Bind("MinSpecialChar") %>' />
                            <br />
                            Minimum Past Password:
                            <asp:TextBox ID="MinPastPasswordTextBox" runat="server" 
                                Text='<%# Bind("MinPastPassword") %>' />
                            <br />
                            Maximum Users:
                            <asp:TextBox ID="MaxUserTextBox" runat="server" Text='<%# Bind("MaxUser") %>' />
                            <br />
                            Initial Amount:
                            <asp:TextBox ID="InitialAmountTextBox" runat="server" 
                                Text='<%# Bind("InitialAmount") %>' />
                            <br />
                            Maximum Password Try:
                            <asp:TextBox ID="MaxPasswordTryTextBox" runat="server" 
                                Text='<%# Bind("MaxPasswordTry") %>' />
                            <br />
                            Referal Amount:
                            <asp:TextBox ID="ReferalAmountTextBox" runat="server" 
                                Text='<%# Bind("ReferalAmount") %>' />
                            <br />
                            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                                CommandName="Update" Text="Update" />
                            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                        </EditItemTemplate>
                        <InsertItemTemplate>
                                                        Global Setting ID:
                                                        <asp:TextBox ID="GlobalSettingIDTextBox" runat="server" 
                                                            Text='<%# Bind("GlobalSettingID") %>' />
                            <br />
                                                        Password Length:
                            <asp:TextBox ID="PasswordLengthTextBox" runat="server" 
                                Text='<%# Bind("PasswordLength") %>' />
                            <br />
                                                        Password Expiry:
                            <asp:TextBox ID="PasswordExpiryTextBox" runat="server" 
                                Text='<%# Bind("PasswordExpiry") %>' />
                            <br />
                                                        Minimum Upper-Case:
                            <asp:TextBox ID="MinUpperCaseTextBox" runat="server" 
                                Text='<%# Bind("MinUpperCase") %>' />
                            <br />
                                                        Minimum Lower-Case:
                            <asp:TextBox ID="MinLowerCaseTextBox" runat="server" 
                                Text='<%# Bind("MinLowerCase") %>' />
                            <br />
                                                        Minimum Special-Char:
                            <asp:TextBox ID="MinSpecialCharTextBox" runat="server" 
                                Text='<%# Bind("MinSpecialChar") %>' />
                            <br />
                                                        Minimum Past Password:
                            <asp:TextBox ID="MinPastPasswordTextBox" runat="server" 
                                Text='<%# Bind("MinPastPassword") %>' />
                            <br />
                                                        Maximum Users:
                            <asp:TextBox ID="MaxUserTextBox" runat="server" Text='<%# Bind("MaxUser") %>' />
                            <br />
                                                        Initial Amount:
                            <asp:TextBox ID="InitialAmountTextBox" runat="server" 
                                Text='<%# Bind("InitialAmount") %>' />
                            <br />
                                                        Maximum Password Try:
                            <asp:TextBox ID="MaxPasswordTryTextBox" runat="server" 
                                Text='<%# Bind("MaxPasswordTry") %>' />
                            <br />
                                                        Referal Amount:
                            <asp:TextBox ID="ReferalAmountTextBox" runat="server" 
                                Text='<%# Bind("ReferalAmount") %>' />
                            <br />
                            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                                CommandName="Insert" Text="Insert" />
                            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                        </InsertItemTemplate>
                        <ItemTemplate>
                            Global Setting ID:
                            <asp:Label ID="GlobalSettingIDLabel" runat="server" 
                                Text='<%# Eval("GlobalSettingID") %>' />
                            <br />
                            Password Length:
                            <asp:Label ID="PasswordLengthLabel" runat="server" 
                                Text='<%# Bind("PasswordLength") %>' />
                            <br />
                            Password Expiry:
                            <asp:Label ID="PasswordExpiryLabel" runat="server" 
                                Text='<%# Bind("PasswordExpiry") %>' />
                            <br />
                            Minimum Upper-Case:
                            <asp:Label ID="MinUpperCaseLabel" runat="server" 
                                Text='<%# Bind("MinUpperCase") %>' />
                            <br />
                            Minimum Lower-Case:
                            <asp:Label ID="MinLowerCaseLabel" runat="server" 
                                Text='<%# Bind("MinLowerCase") %>' />
                            <br />
                            Minimum Special-Char:
                            <asp:Label ID="MinSpecialCharLabel" runat="server" 
                                Text='<%# Bind("MinSpecialChar") %>' />
                            <br />
                            Minimum Past Password:
                            <asp:Label ID="MinPastPasswordLabel" runat="server" 
                                Text='<%# Bind("MinPastPassword") %>' />
                            <br />
                            Maximum Users:
                            <asp:Label ID="MaxUserLabel" runat="server" Text='<%# Bind("MaxUser") %>' />
                            <br />
                            Initial Amount:
                            <asp:Label ID="InitialAmountLabel" runat="server" 
                                Text='<%# Bind("InitialAmount") %>' />
                            <br />
                            Maximum Password Try:
                            <asp:Label ID="MaxPasswordTryLabel" runat="server" 
                                Text='<%# Bind("MaxPasswordTry") %>' />
                            <br />
                            Referal Amount:
                            <asp:Label ID="ReferalAmountLabel" runat="server" 
                                Text='<%# Bind("ReferalAmount") %>' />
                            <br />
                            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                                CommandName="Edit" Text="Edit" />
                            &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                                CommandName="Delete" Text="Delete" />
                            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                                CommandName="New" Text="New" />
                        </ItemTemplate>
                    </asp:FormView>
                </td>
                <td class="style14" valign="top" bgcolor="#F0F3F4" 
                    style="border: thin solid #000000">
                    <asp:FormView ID="FormView2" runat="server" AllowPaging="True" CellPadding="4" 
                        DataSourceID="SqlDataSource2" ForeColor="#333333" Height="100px" style="text-align: left; font-size: medium" 
                        Width="376px">
                        <EditItemTemplate>
                            Game Name:
                            <asp:TextBox ID="GameNameTextBox" runat="server" 
                                Text='<%# Bind("GameName") %>' />
                            <br />
                            Game Elapsed Date:
                            <asp:TextBox ID="GameElapsedDateTextBox" runat="server" 
                                Text='<%# Bind("GameElapsedDate") %>' />
                            <br />
                            Game Elapsed Speed:
                            <asp:TextBox ID="GameElapsedSpeedTextBox" runat="server" 
                                Text='<%# Bind("GameElapsedSpeed") %>' />
                            <br />
                            Game Allowed User:
                            <asp:TextBox ID="GameAllowedUserTextBox" runat="server" 
                                Text='<%# Bind("GameAllowedUser") %>' />
                            <br />
                            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                                CommandName="Update" Text="Update" />
&nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" 
                                CommandName="Cancel" Text="Cancel" />
                        </EditItemTemplate>
                        <EditRowStyle BackColor="#999999" />
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <InsertItemTemplate>
                            Game Name:
                            <asp:TextBox ID="GameNameTextBox" runat="server" 
                                Text='<%# Bind("GameName") %>' />
                            <br />
                            Game Elapsed Date:
                            <asp:TextBox ID="GameElapsedDateTextBox" runat="server" 
                                Text='<%# Bind("GameElapsedDate") %>' />
                            <br />
                            Game Elapsed Speed:
                            <asp:TextBox ID="GameElapsedSpeedTextBox" runat="server" 
                                Text='<%# Bind("GameElapsedSpeed") %>' />
                            <br />
                            Game Allowed User:
                            <asp:TextBox ID="GameAllowedUserTextBox" runat="server" 
                                Text='<%# Bind("GameAllowedUser") %>' />
                            <br />
                            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                                CommandName="Insert" Text="Insert" />
                            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                        </InsertItemTemplate>
                        <ItemTemplate>
                            Game Name:
                            <asp:Label ID="GameNameLabel" runat="server" Text='<%# Bind("GameName") %>' />
                            <br />
                            Game Elapsed Date:
                            <asp:Label ID="GameElapsedDateLabel" runat="server" 
                                Text='<%# Bind("GameElapsedDate") %>' />
                            <br />
                            Game Elapsed Speed:
                            <asp:Label ID="GameElapsedSpeedLabel" runat="server" 
                                Text='<%# Bind("GameElapsedSpeed") %>' />
                            <br />
                            Game Allowed User:
                            <asp:Label ID="GameAllowedUserLabel" runat="server" 
                                Text='<%# Bind("GameAllowedUser") %>' />
                            <br />
                            <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                                CommandName="New" Text="New" />
                        </ItemTemplate>
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    </asp:FormView>
                </td>
            </tr>
            <tr>
                <td class="style13" valign="top" style="border: thin solid #000000">
                    &nbsp;</td>
            </tr>
            </table>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:stockmarketConnectionString %>" 
        DeleteCommand="DELETE FROM [GameUsers] WHERE [UserName] = @original_UserName AND [GameID] = @original_GameID" 
        InsertCommand="INSERT INTO [GameUsers] ([UserName], [GameID]) VALUES (@UserName, @GameID)" 
        OldValuesParameterFormatString="original_{0}" 
        SelectCommand="SELECT * FROM [GameUsers]">
        <DeleteParameters>
            <asp:Parameter Name="original_UserName" Type="String" />
            <asp:Parameter Name="original_GameID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="UserName" Type="String" />
            <asp:Parameter Name="GameID" Type="Int32" />
        </InsertParameters>
    </asp:SqlDataSource>
    <h2 class="bold">
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:stockmarketConnectionString %>" 
        
        
            SelectCommand="SELECT [GameName], [GameElapsedDate], [GameElapsedSpeed], [GameAllowedUser] FROM [Game]" 
        OldValuesParameterFormatString="original_{0}" 
            InsertCommand="INSERT INTO [Game] ([GameName], [GameElapsedDate], [GameElapsedSpeed], [GameAllowedUser]) VALUES (@GameName, @GameElapsedDate, @GameElapsedSpeed, @GameAllowedUser)">
        <InsertParameters>
            <asp:Parameter Name="GameName" Type="String" />
            <asp:Parameter DbType="Date" Name="GameElapsedDate" />
            <asp:Parameter Name="GameElapsedSpeed" Type="Int32" />
            <asp:Parameter Name="GameAllowedUser" Type="Int32" />
        </InsertParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:stockmarketConnectionString %>" 
        OldValuesParameterFormatString="original_{0}" 
        
        
            
            
            SelectCommand="SELECT [GlobalSettingID], [PasswordLength], [PasswordExpiry], [MinUpperCase], [MinLowerCase], [MinSpecialChar], [MinPastPassword], [MaxUser], [InitialAmount], [MaxPasswordTry], [ReferalAmount] FROM [GlobalSetting]" 
            DeleteCommand="DELETE FROM [GlobalSetting] WHERE [GlobalSettingID] = @original_GlobalSettingID" 
            InsertCommand="INSERT INTO [GlobalSetting] ([GlobalSettingID], [PasswordLength], [PasswordExpiry], [MinUpperCase], [MinLowerCase], [MinSpecialChar], [MinPastPassword], [MaxUser], [InitialAmount], [MaxPasswordTry], [ReferalAmount]) VALUES (@GlobalSettingID, @PasswordLength, @PasswordExpiry, @MinUpperCase, @MinLowerCase, @MinSpecialChar, @MinPastPassword, @MaxUser, @InitialAmount, @MaxPasswordTry, @ReferalAmount)" 
            
            UpdateCommand="UPDATE [GlobalSetting] SET [PasswordLength] = @PasswordLength, [PasswordExpiry] = @PasswordExpiry, [MinUpperCase] = @MinUpperCase, [MinLowerCase] = @MinLowerCase, [MinSpecialChar] = @MinSpecialChar, [MinPastPassword] = @MinPastPassword, [MaxUser] = @MaxUser, [InitialAmount] = @InitialAmount, [MaxPasswordTry] = @MaxPasswordTry, [ReferalAmount] = @ReferalAmount WHERE [GlobalSettingID] = @original_GlobalSettingID">
        <DeleteParameters>
            <asp:Parameter Name="original_GlobalSettingID" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="GlobalSettingID" Type="String" />
            <asp:Parameter Name="PasswordLength" Type="Int16" />
            <asp:Parameter Name="PasswordExpiry" Type="Int16" />
            <asp:Parameter Name="MinUpperCase" Type="Int16" />
            <asp:Parameter Name="MinLowerCase" Type="Int16" />
            <asp:Parameter Name="MinSpecialChar" Type="Int16" />
            <asp:Parameter Name="MinPastPassword" Type="Int16" />
            <asp:Parameter Name="MaxUser" Type="Int32" />
            <asp:Parameter Name="InitialAmount" Type="Int32" />
            <asp:Parameter Name="MaxPasswordTry" Type="Int32" />
            <asp:Parameter Name="ReferalAmount" Type="Double" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="PasswordLength" Type="Int16" />
            <asp:Parameter Name="PasswordExpiry" Type="Int16" />
            <asp:Parameter Name="MinUpperCase" Type="Int16" />
            <asp:Parameter Name="MinLowerCase" Type="Int16" />
            <asp:Parameter Name="MinSpecialChar" Type="Int16" />
            <asp:Parameter Name="MinPastPassword" Type="Int16" />
            <asp:Parameter Name="MaxUser" Type="Int32" />
            <asp:Parameter Name="InitialAmount" Type="Int32" />
            <asp:Parameter Name="MaxPasswordTry" Type="Int32" />
            <asp:Parameter Name="ReferalAmount" Type="Double" />
            <asp:Parameter Name="original_GlobalSettingID" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
</asp:Content>

